<!DOCTYPE html>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <title>JS控制音乐播放</title>
    <script>
        function showMusicInfo(name,url,process){
            document.getElementById("text1").innerHTML='歌曲名：'+name;
            document.getElementById("text2").innerHTML='地址：'+url;
            document.getElementById("text3").innerHTML='进度：'+process;
        }
        function playEnd(){
            document.getElementById("text4").innerHTML='播放完毕';
        }
        <!--安卓会定时调用执行该方法-->
        function getTimerState(){
            android.setTimerState(true);
        }
    </script>
</head>
<body>

<h1> JS 控制音乐播放 </h1>

<button type="button"
        onclick="javascript:android.playUrl('testname','http://file.kuyinyun.com/group1/M00/90/B7/rBBGdFPXJNeAM-nhABeMElAM6bY151.mp3')">
    playUrl
</button>
</br></br>
<button type="button" onclick="javascript:android.play()"> play</button>
</br>
<button type="button" onclick="javascript:android.pause()"> pause</button>
</br>
<button type="button" onclick="javascript:android.showToast('这是一个测试吐司')">吐司</button>
</br>
<button type="button" onclick="javascript:android.seekTo('50')">seek</button>
</br>
<button type="button" onclick="javascript:android.getPlayInfo()">getPlayInfo</button>
</br>

<span id="text1"> name </span> <span id="text3"> process </span>
<p id="text2"> url </p>

<p id="text4"> ---- </p>
</body>
</html>